package 双指针;

/**
 * @author tmh
 * @date 2024/9/9 21:38
 * @description
 */
public class T11盛最多水的容器 {
    public int maxArea(int[] height) {
        int max = 0;
        for (int i=0,j=height.length-1;i<j;){
            int minHeight = height[i]>=height[j]?height[j--]:height[i++];
            max = Math.max(max,minHeight*(j-i+1));
        }
        return max;
    }
}
